<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html lang="en">
<head>
	<%@include file="/WEB-INF/jsp/qsws/commons/head.jsp" %>

    <link rel="stylesheet" type="text/css" href="resources/qsws/css/nav.css">

    <script src="resources/libs/flexible.js" type="text/javascript"></script>

	<script src="resources/libs/angular.js" type="text/javascript"></script>
	<script src="resources/libs/anglar-router.js" type="text/javascript"></script>
</head>
<body ng-app='ngRouteApp'>
	<div ng-view></div>
	<footer>
        <ul class="clearfix">
            <a href="qsws#page1"><li class="zb"><p>直播</p></li></a>
            <a href="qsws#page2"><li class="ws"><p>微视</p></li></a>
            <a href="qsws#index"><li class="index"><p>首页</p></li></a>
            <a href="qsws#info"><li class="info"><p>资讯</p></li></a>
            <a href="qsws#page5"><li class="me"><p>我的</p></li></a>
        </ul>
	</footer>
</body>
<script>
	var currLinkSuffix = window.location.hash;
	currLinkSuffix = currLinkSuffix.substring(currLinkSuffix.indexOf('/') + 1);
	$('.' + currLinkSuffix).addClass('curr');
	var imgRelativePath = 'resources/qsws/img/';
	$('.curr').css('background-image','url(' + imgRelativePath + $('.curr').attr('class').split(/\s+/)[0] + '2.png)');
	$('footer li').click(function(){
		$(this).addClass('curr').parent().siblings().find('li').removeClass('curr');
		$('footer li').each(function(){
			$(this).css('background-image','url(' + imgRelativePath + $(this).attr('class').split(/\s+/)[0] + '1.png)');
		})
		$(this).css('background-image','url(' + imgRelativePath + $(this).attr('class').split(/\s+/)[0] + '2.png)');
	})
</script>
<script type="text/javascript">

	 //设置模块与ngRoute的依赖关系
	angular.module("ngRouteApp", ["ngRoute"])
	 .config(['$routeProvider', function($routeProvider){
	     $routeProvider
	     //定义路由规则(若URL路径为“/page1”则加载childPage1.html),语法类似switch case default
	         .when("/page1",{template:'1'})
	         .when("/page2",{template:'2'})
	         .when("/index",{templateUrl : "qsws/toIndex"}) 
	         .when("/info",{templateUrl : "qsws/toArticleListPage"})
	         .when("/page5",{template:'5'}) 
	         .otherwise({redirectTo: "index"});
	 }]
	);
</script>
</html>